#pragma once
#include"HashTable.hpp"
#include"unordered_map.hpp"
namespace redisStruct
{
	template<class Key, class HashFunc = Hash<Key>, class EqualOfK = Equal<Key>, class CopyOfK = CopyOfT<Key>, class FreeOfK = FreeOfT<Key>>
	class unordered_set
	{
		struct KOfT
		{
			const Key& operator()(const Key& key)
			{
				return key;
			}
		};
	private:
		HashTable<Key, Key, KOfT, HashFunc, EqualOfK, CopyOfK, FreeOfK> _ht;
	public:
		typedef typename HashTable<Key, Key, KOfT, HashFunc, EqualOfK, CopyOfK,FreeOfK>::iterator iterator;
		typedef typename HashTable<Key, Key, KOfT, HashFunc, EqualOfK, CopyOfK, FreeOfK>::const_iterator const_iterator;
		unordered_set() = default;
		iterator begin()
		{
			return _ht.begin();
		}
		const_iterator begin() const
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		const_iterator end() const
		{
			return _ht.end();
		}
		iterator find(const Key& key)
		{
			return _ht.find(key);
		}
		bool insert(const Key& key)
		{
			return _ht.insert(key).second;
		}
		iterator erase(const Key& key)
		{
			return _ht.erase(key);
		}
        size_t size() const
        {
            _ht.size();
        }
	};
}